package com.banyuan.项目测试;

import com.banyuan.项目.test;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextPane;
import java.awt.Font;
import javax.swing.JTextField;
import java.awt.Color;
import java.awt.SystemColor;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Server {

    private JFrame frame;
    private JTextField textField;

    /**
     * Launch the application.
     */
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    Server window = new Server();
                    window.frame.setVisible(true);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    /**
     * Create the application.
     */
    public Server() {
        initialize();
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
        frame = new JFrame();
        frame.setTitle("半圆聊天室服务端");
        frame.setBounds(100, 100, 529, 505);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(null);

        JButton btnNewButton = new JButton("端口设置");
        btnNewButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
            }
        });
        btnNewButton.setBounds(6, 6, 96, 29);
        frame.getContentPane().add(btnNewButton);

        JButton btnNewButton_1 = new JButton("启动服务");
        btnNewButton_1.setBounds(114, 6, 96, 29);
        btnNewButton_1.addActionListener((e) -> {

        });
        frame.getContentPane().add(btnNewButton_1);

        JButton btnNewButton_2 = new JButton("退出");
        btnNewButton_2.setBounds(222, 6, 96, 29);
        frame.getContentPane().add(btnNewButton_2);

        JTextArea textArea = new JTextArea();
        textArea.setBounds(6, 40, 517, 331);
        frame.getContentPane().add(textArea);

        JLabel label = new JLabel("发送消息至：");
        label.setBounds(6, 383, 83, 29);
        frame.getContentPane().add(label);

        JComboBox comboBox = new JComboBox();
        comboBox.setModel(new DefaultComboBoxModel(new String[]{"所有人"}));
        comboBox.setBounds(84, 383, 110, 27);
        frame.getContentPane().add(comboBox);

        JLabel label_1 = new JLabel("发送消息：");
        label_1.setBounds(6, 422, 83, 19);
        frame.getContentPane().add(label_1);

        JButton btnNewButton_3 = new JButton("发送");
        btnNewButton_3.setBounds(406, 418, 117, 29);
        frame.getContentPane().add(btnNewButton_3);

        textField = new JTextField();
        textField.setBounds(61, 418, 345, 29);
        frame.getContentPane().add(textField);
        textField.setColumns(10);

        JTextPane textPane = new JTextPane();
        textPane.setText("当前在线人数0");
        textPane.setBackground(SystemColor.window);
        textPane.setForeground(Color.LIGHT_GRAY);
        textPane.setBounds(6, 453, 507, 19);
        frame.getContentPane().add(textPane);
    }
}
